//package net.lzzy.practices.entities;
//
//import lombok.Getter;
//import lombok.NoArgsConstructor;
//import lombok.Setter;
//import javax.persistence.*;
//import java.util.ArrayList;
//import java.util.List;
//
//@Entity
//@Getter
//@Setter
//@NoArgsConstructor
//public class Question extends BaseEntity {
//    @Transient
//    public static final int TYPE_SINGLE = 0;
//    @Transient
//    public static final int TYPE_JUDGE = 1;
//    @Transient
//    public static final int TYPE_NULTI = 2;
//    private int type;
//    private String content;
//    private String analysis;
//    private int ordinal;
//    @OneToMany(mappedBy = "question", cascade = CascadeType.PERSIST)
//    private List<Option> options = new ArrayList<>();
//    @ManyToOne
//    private Chapter chapter;
//    @OneToMany(mappedBy = "question")
//    private List<Result> results = new ArrayList<>();
//}
package net.lzzy.practices.entities;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Entity
@Getter
@Setter
@NoArgsConstructor
public class Question extends BaseEntity {
    @Transient
    public static final int TYPE_SINGLE = 0;
    @Transient
    public static final int TYPE_JUDGE = 1;
    @Transient
    public static final int TYPE_NULTI = 2;
    private int type;
    private String content;
    private String analysis;
    private int ordinal;
    @OneToMany(mappedBy = "question", cascade = CascadeType.PERSIST)
    private List<Option> options = new ArrayList<>();
    @ManyToOne
    private Chapter chapter;
    @OneToMany(mappedBy = "question")
    private List<Result> results = new ArrayList<>();

//    // 添加setCreateTime方法
//    public void setCreateTime(Date createTime) {
//        super.setCreateTime(createTime);
//    }
}